# -*- coding: utf-8 -*-
# @Time    : 2020/11/8 20:45
# @Author  : DuJiabao
# @File    : queue.py
# @Description : 这是一个基于链表的队列
class Node(object):
    def __init__(self, name):
        self.name = name
        self.next = None


class Queue(object):
    def __init__(self):
        self.tail = Node(None)

    def Enqueue(self, name):
        new = Node(name)
        new.next = self.tail.next
        self.tail.next = new

    def Dequeue(self):
        if self.tail.next is None:
            return False
        point = self.tail
        while point.next:
            prePoint = point
            point = point.next
        prePoint.next = None
        return point


if __name__ == '__main__':
    pass
